Skip to content

Instantly share code, notes, and snippets.

@ericchansen
ericchansen / monitor_usb.ps1
Created May 24, 2023 18:19
PowerShell script to monitor device connects and disconnects on Windows.
$CurrentState = $null
$NewState = $null
Write-Host "Monitoring device changes..." -ForegroundColor Green
while ($true) {
if (-not($CurrentState)) {
$CurrentState = Get-PnpDevice -Status OK
}
else {
$NewState = Get-PnpDevice -Status OK
$Changes = $null
@v1mkss
v1mkss / JetBrains Activation.md
Last active May 22, 2024 03:18
JetBrains Activation

JetBrains Activation

  • No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, *.micronaut.io, *.quarkus.io, *.scala-sbt.org, *.schemastore.org, *.spring.io, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, jitpack.io, micronaut.io, plugins.jetbrains.com, quarkus.io, repo.papermc.io, resources.jetbrains.com, spring.io, www.jetbrains.com

Activation Key:

UX394X3HLT-eyJsaWNlbnNlSWQiOiJVWDM5NFgzSExUIiwibGljZW5zZWVOYW1lIjoiSG9uZ2lrIFVuaXZlcnNpdHntmY3snbXrjIDtlZnqtZAiLCJsaWNlbnNlZVR5cGUiOiJDTEFTU1JPT00iLCJhc3NpZ25lZU5hbWUiOiLkvJfliJvkupEg5bel5L2c5a6kIiwiYXNzaWduZWVFbWFpbCI6ImhhbmF6YXdhbWl0b0BnbWFpbC5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJG
@grahamperrin
grahamperrin / freebsd-descriptive-repo-names.md
Last active May 22, 2024 03:16
Using descriptive repository names for FreeBSD-provided and locally-built packages

Using descriptive repository names for FreeBSD-provided and locally-built packages

Three distinctive names

% pkg -vv | grep -B 1 -e url -e priority
  FreeBSD-ports: { 
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/latest",
    enabled         : yes,
 priority : 2,
@nickrouty
nickrouty / rd-class-text-extraction.php
Created May 9, 2018 04:14
Class for extraction the text from doc, docx, xlsx, pptx and wrapper for 3rd party pdf to text library.
<?php
/**
* Class RD_Text_Extraction
*
* Example usage:
*
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file);
*
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class.
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 22, 2024 03:10
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@Jonas-Sander
Jonas-Sander / awtrix_spotify_nowPlaying.yaml
Last active May 22, 2024 03:08
awtrix_spotify_nowPlaying.yaml
alias: Awtrix Spotify NowPlaying 🎹
description:
trigger:
- platform: state
entity_id: media_player.spotify
action:
- choose:
- conditions:
- condition: state
entity_id: media_player.spotify
@ZenGround0
ZenGround0 / OPP.md
Created May 22, 2024 01:57
Onramp Protocol Prototype

Summary

The FVM brings smart contracts to filecoin allowing developers to do productive novel things with verifiable data. One obvious thing to do is allow clients to put data on filecoin more easily. Enabling onboarding small pieces is better for users but worse for scale which motivates bridging to higher throughput lower latency lower cost systems like blockchain L2s. Some redesigning of the standard client contract flow is needed for things to work on L2s. Essentially the contract should be split into two halves: an expensive contract onboarding, aggregating and paying for data and an efficient contract transmitting proof of data storage.

FilOz is building a prototype of this here: https://github.com/ZenGround0/onramp-contracts/tree/main so that developers can build applications more easily following this design.

We're currently prototyping. First getting it working with L1 and L2 == Filecoin, then getting it working with true bridging on calibration net. Once we're done we'll measure performance

@arxdsilva
arxdsilva / tokenGeneratorExample.go
Last active May 22, 2024 03:06
Golang - How to generate a random Token
package main
// https://play.golang.org/p/5VsRVVtyo-J
import (
"crypto/rand"
"fmt"
)
func tokenGenerator() string {